#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  missing.py
#       Author @  Huoty
#  Create date @  2016-07-02 19:59:21
#  Description @  
# *************************************************************

class FooDict(dict):
    def __missing__(self, key):
        self[key] = "Yes"
        return "Yes"
        

# Script starts from here

if __name__ == "__main__":
    fdict = FooDict()
    print fdict
    print fdict["bar"]
